#coding=utf-8
"""
Author:杭州多测师_周sir
Time:2025/8/28 10:26
website:https://duoceshi.net
"""

'''
此模块是用来读取Excel表格的工具类
读取表格需要用到xlrd模块
在dos窗口：pip install xlrd==1.2.0
'''
import xlrd
from config.config import *
import os
class Read_Excel():

    def __init__(self,filename,sheet_Name):
        # 打开一个Excel表格
        self.workbook = xlrd.open_workbook(filename)
        # 进入到sheet页面
        self.sheetName = self.workbook.sheet_by_name(sheet_Name)
    def get_excel_data(self,row,col):
        '''
        封装一个通过行和列来获取Excel表格中的数据
        '''
        value = self.sheetName.cell(row,col).value
        return value
file = os.path.join(data_path,'data.xls')
excel = Read_Excel(file,"Sheet1")
url = excel.get_excel_data(1,0)  # 根据索引位取url地址
# print(url)

